const axios = require('axios');
const axiosDef = {
    request: (url, method, data = {}, options = {}) => {
        return new Promise((resolve, reject) => {
            axios({
                method,
                url,
                // data,
                // headers = {
                //     'Content-Type': 'application/json'
                // },
                ...options
            }).then((res) => {
                console.log("请求结果===", res);
                reject(res.data);
            }).catch((error) => {
                reject(error);
            })
        })
    }
}

module.exports = axiosDef;